const Joi = require('joi');

module.exports = {
  addrAddSchema: Joi.object({
    consignee: Joi.string().min(1).required(),
    phone: Joi.string()
      .pattern(/^(?:(?:\+|00)86)?1\d{10}$/)
      .required(),
    address: Joi.string().min(1).required(),
    is_default: Joi.boolean(),
  }),
  addrUpdateSchema: Joi.object({
    id: Joi.number().required(),
    consignee: Joi.string().min(1),
    phone: Joi.string()
      .pattern(/^(?:(?:\+|00)86)?1\d{10}$/),
    address: Joi.string().min(1),
  }).or('consignee', 'phone', 'address'),
};
